//存在重复元素I
import java.util.HashSet;
import java.util.Set;

class Solution1 {
    public boolean containsDuplicate(int[] nums) {
        Set<Integer> set = new HashSet<>();
        for(int x:nums){
            if(!set.add(x)){
                return true;
            }
        }
     return false;
    }
}